package com.company.cloud.sdk.modules.service.impl;

import com.company.cloud.mini.modules.sdk.response.AccessTokenEntity;
import com.company.cloud.sdk.core.config.WxApiConfig;
import com.company.cloud.mini.modules.sdk.api.MiniWxApi;
import com.company.cloud.mini.modules.sdk.response.DecryptModel;
import com.company.cloud.mini.modules.sdk.response.ThirdUserEntity;
import com.company.cloud.sdk.modules.service.MiniWxSdkService;
import org.springframework.stereotype.Service;

@Service
public class MiniWxSdkServiceImpl implements MiniWxSdkService {

    @Override
    public AccessTokenEntity getAccessToken(WxApiConfig wxConfig) {
        return MiniWxApi.getToken(wxConfig);
    }

    @Override
    public ThirdUserEntity getThirdUser(String code, WxApiConfig config) {
        return MiniWxApi.getThirdUser(code,config);
    }

    @Override
    public DecryptModel decryptData(String encryptedData, String iv, String sessionKey) {
        return MiniWxApi.decryptData(encryptedData,iv,sessionKey);
    }
}
